Skip to content

Method: DefinitionFileSelectionState(Scanner, Integer, Integer)

1: package scanner;
2:
3: import symbols.AbstractSymbol;
4: import basic.Buffer;
5:
6: /**
7: * This class represents the DefinitionFileSelectionState.
8: *
9: * @author HFW410
10: *
11: */
12: public class DefinitionFileSelectionState extends AbstractState {
13:         /**
14:          * This constructor initialize the new DefinitionFileSelectionState.
15:          *
16:          * @param myScanner
17:          * is the used scanner.
18:          * @param beginningColumn
19:          * is the Begin Column of the Symbol
20:          * @param beginningRow
21:          * is the beginning row of the symbol
22:          */
23:         public DefinitionFileSelectionState(final Scanner myScanner, final Integer beginningColumn,
24:                         final Integer beginningRow) {
25:                 super(myScanner, beginningColumn, beginningRow);
26:         }
27:
28:         @Override
29:         public AbstractState action(final Character character,
30:                         final Buffer<AbstractSymbol> currentResult, final String dataPath) {
31:                 if (character.equals(ScannerConstants.REGEXP.charAt(0))) {
32:                         this.getMyScanner().skip();
33:                         return new RegExpBeginSelectionState1(this.getMyScanner(), this.getBeginningColumn(),
34:                                         this.getBeginningRow());
35:                 } else {
36:                         return new SelectionState(this.getMyScanner(), this.getBeginningColumn(),
37:                                         this.getBeginningRow()).action(character, currentResult, dataPath);
38:                 }
39:
40:         }
41:
42:         @Override
43:         protected void finish(final Buffer<AbstractSymbol> currentResult, final String dataPath) {
44:
45:         }
46:
47: }